package com.ruoyi.exa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exa.mapper.ExaParperClassMapper;
import com.ruoyi.exa.domain.ExaParperClass;
import com.ruoyi.exa.service.IExaParperClassService;

/**
 * 试卷题目Service业务层处理
 * 
 * @author linziheng
 * @date 2025-07-15
 */
@Service
public class ExaParperClassServiceImpl implements IExaParperClassService 
{
    @Autowired
    private ExaParperClassMapper exaParperClassMapper;

    /**
     * 查询试卷题目
     * 
     * @param id 试卷题目主键
     * @return 试卷题目
     */
    @Override
    public ExaParperClass selectExaParperClassById(Long id)
    {
        return exaParperClassMapper.selectExaParperClassById(id);
    }

    /**
     * 查询试卷题目列表
     * 
     * @param exaParperClass 试卷题目
     * @return 试卷题目
     */
    @Override
    public List<ExaParperClass> selectExaParperClassList(ExaParperClass exaParperClass)
    {
        return exaParperClassMapper.selectExaParperClassList(exaParperClass);
    }

    /**
     * 新增试卷题目
     * 
     * @param exaParperClass 试卷题目
     * @return 结果
     */
    @Override
    public int insertExaParperClass(ExaParperClass exaParperClass)
    {
        exaParperClass.setCreateTime(DateUtils.getNowDate());
        return exaParperClassMapper.insertExaParperClass(exaParperClass);
    }

    /**
     * 修改试卷题目
     * 
     * @param exaParperClass 试卷题目
     * @return 结果
     */
    @Override
    public int updateExaParperClass(ExaParperClass exaParperClass)
    {
        exaParperClass.setUpdateTime(DateUtils.getNowDate());
        return exaParperClassMapper.updateExaParperClass(exaParperClass);
    }

    /**
     * 批量删除试卷题目
     * 
     * @param ids 需要删除的试卷题目主键
     * @return 结果
     */
    @Override
    public int deleteExaParperClassByIds(Long[] ids)
    {
        return exaParperClassMapper.deleteExaParperClassByIds(ids);
    }

    /**
     * 删除试卷题目信息
     * 
     * @param id 试卷题目主键
     * @return 结果
     */
    @Override
    public int deleteExaParperClassById(Long id)
    {
        return exaParperClassMapper.deleteExaParperClassById(id);
    }
    @Override
    public void deleteExaParperClassByParperId(Long parperId)
    {
        exaParperClassMapper.deleteExaParperClassByParperId(parperId);
    }
}
